/**学科交叉创新人才培养项目管理 */
<template>
  <div>
    <div v-if="indexKey === 1">
      <condition-card @reset="resetSearch" @search="onSearch" label-position="right" label-width="170px">
        <el-row :gutter="24" style="height: 50px;">
          <el-col :span="8">
            <el-form-item :label="$t('interdisciplinaryManagement.jobNumber')">
              <el-input v-model.trim="queryForm.condition.teacherId" style="width:100%"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item :label="$t('interdisciplinaryManagement.name')">
              <el-input v-model.trim="queryForm.condition.teacherName" style="width:100%"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item :label="$t('interdisciplinaryManagement.country')">
              <el-select v-model="queryForm.condition.nationId" @change="changeCountry" clearable filterable style="width:100%">
                <el-option
                  v-for="item in options.country"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item :label="$t('interdisciplinaryManagement.nameSchool')" >
              <el-select
                v-model="queryForm.condition.collegeCode"
                filterable clearable
                reserve-keyword style="width:100%"
                placeholder="请输入关键词"
                :remote-method="remoteMethod"
                :loading="loading">
                <el-option
                  v-for="item in options.nameSchool"
                  :key="item.collegeCode"
                  :label="item.collegeName"
                  :value="item.collegeCode">
                </el-option>
              </el-select>
             <!-- <el-select v-model="queryForm.condition.nameSchool" @change="changeNameSchool" clearable filterable style="width:100%">
                <el-option
                  v-for="item in options.nameSchool"
                  :key="item.collegeCode"
                  :label="item.collegeName"
                  :value="item.collegeCode">
                </el-option>
              </el-select> -->
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item :label="$t('interdisciplinaryManagement.appliesStartExchange')">
              <el-date-picker style="width:100%"
                v-model="queryForm.condition.tutorStartTime"
                :picker-options="pickerOptionsStart"
                type="date"
                value-format="yyyy-MM-dd"
                format="yyyy-MM-dd"
                >
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item :label="$t('interdisciplinaryManagement.appliesEndExchange')" >
              <el-date-picker style="width:100%"
                v-model="queryForm.condition.tutorEndTime"
                type="date"
                :picker-options="pickerOptionsEnd"
                value-format="yyyy-MM-dd"
                format="yyyy-MM-dd"
                >
                
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item :label="$t('interdisciplinaryManagement.studentsStartExchange')">
              <el-date-picker style="width:100%"
                v-model="queryForm.condition.studentStartTime"
                type="date"
                :picker-options="pickerStudentStart"
                value-format="yyyy-MM-dd"
                format="yyyy-MM-dd"
                >
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item :label="$t('interdisciplinaryManagement.studentsEndExchange')" >
              <el-date-picker style="width:100%"
                v-model="queryForm.condition.studentEndTime"
                type="date"
                :picker-options="pickerStudentEndTime"
                value-format="yyyy-MM-dd"
                format="yyyy-MM-dd"
                >
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
      </condition-card>
      <el-card shadow="never" v-loading="loading" body-style="padding: 24px;" class="card-margin">
        <h1 class="condition-title">{{$t('interdisciplinaryManagement.interdisciplinaryList')}}</h1>
       <div class="edu-opertion-bar sub-title">
        <div class="float-right" style="display: flex;">
          <el-dropdown placement='bottom-start' trigger="click" @command="downloadFile">
            <el-button type="primary">{{$t('internship.lead')}}<i class="el-icon-arrow-down el-icon--right"></i></el-button>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item command="导入">{{$t('导入数据')}}</el-dropdown-item>
              <el-dropdown-item command="下载">{{$t('internship.download')}}</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
            <el-upload 
              class="upload-demo"
              action="/api/externalexchangeservice/interdiscipline/importExcel" 
              :on-success="changeSuccess"
              :auto-upload="true"
              :imit="1"
              :before-upload='changeUpload'
              :file-list="fileList"
              style="display: none;"
              >
              <span slot="trigger" ref="importBtn">{{$t('导入文件')}}</span>
              
            </el-upload>
            <el-dialog
              :title="$t('导入交叉学科项目')"
              :visible.sync="importConference"
              :close-on-click-modal="false"
              :close-on-press-escape="false"
              width="921px"
            >
            <!-- <el-row type="flex" class="row-bg" justify="space-between"> -->
              <el-button type="primary" style="margin-left:30%" @click="leadFile('导入')">{{$t('导入文件')}}</el-button>
              <div style="margin-left:28%;margin-top:10px">{{$t('conOfIntAcaCon.uploadNotice')}}</div>
              <!-- <div slot="tip" class="el-upload__tip" >{{$t('conOfIntAcaCon.uploadNotice')}}</div> -->
              <!-- <el-button type="primary" style="margin-left:10px" @click="downloadFile('下载')">{{$t('internship.download')}}</el-button> -->
            <!-- </el-row> -->
            <el-table stripe :data="errList" size="mini" width='100%' v-show="ifErr" tooltip-effect="light">
                <!-- 教师工号 -->
                <el-table-column
                    :label="$t('教师工号')"
                    prop="teacherCode"
                    width="100px"
                    show-overflow-tooltip
                ></el-table-column>
                <!-- 教师姓名 -->
                <el-table-column
                    :label="$t('教师姓名')"
                    prop="teacherName"
                    width="100px"
                    show-overflow-tooltip
                ></el-table-column>
                <!-- 学生学号 -->
                <el-table-column
                    :label="$t('学生学号')"
                    prop="studentCode"
                    width="100px"
                    show-overflow-tooltip
                ></el-table-column>
                <!-- 学生姓名 -->
                <el-table-column
                    :label="$t('学生姓名')"
                    prop="studentName"
                    width="100px"
                    show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                    :label="$t('论文题目')"
                    prop="paperTitle"
                    width="100px"
                    show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                    :label="$t('申请学校名称')"
                    prop="schoolName"
                    width="120px"
                    show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                    :label="$t('申请学校英文名称')"
                    prop="schoolNameEn"
                    width="140px"
                    show-overflow-tooltip
                ></el-table-column>
                <!-- 原因 -->
                <el-table-column
                    :label="$t('失败原因')"
                    prop="errorMsg"
                    width="120px"
                    show-overflow-tooltip
                ></el-table-column>
            </el-table>
        </el-dialog>
            <!-- <el-button type="primary" style="margin-left:10px" @click="leadFile">{{$t('internship.lead')}}</el-button> -->
            <el-button type="primary" style="margin-left:10px" @click="exportFile">{{$t('internship.derive')}}</el-button>
            <el-button type="primary" @click="increased">{{$t('interdisciplinaryManagement.increased')}}</el-button>
            <el-button type="danger" @click="remove">{{$t('interdisciplinaryManagement.remove')}}</el-button>
            <!-- <el-button type="primary" @click="startUsin">{{$t('internship.startUsin')}}</el-button>
            <el-button type="primary" @click="exportAdd">{{$t('graduate.add')}}</el-button> -->
        </div>
      </div>
        <edu-table :pagination="false" :tooltipEffect="tooltipEffect" stripe :data="dataList" size="mini" @selection-change="handleSelectionChange">
          <edu-table-column :label="$t('interdisciplinaryManagement.projectNumber')" prop="projectNo"></edu-table-column>
          <edu-table-column :label="$t('interdisciplinaryManagement.college')" prop="teacherCollegeI18n">
          </edu-table-column>
          <edu-table-column :label="$t('interdisciplinaryManagement.jobNumber')" prop="teacherId"></edu-table-column>
          <edu-table-column :label="$t('interdisciplinaryManagement.name')" prop="teacherName"></edu-table-column>
          <edu-table-column :label="$t('interdisciplinaryManagement.country')" prop="nationId">
            <template slot-scope="scope">
              <span>
                 {{scope.row.nationId|collegeAcademyList(options.country)}}
              </span>
            </template>
          </edu-table-column>
          <edu-table-column :label="$t('interdisciplinaryManagement.nameSchool')" prop="collegeName" width="120">
          </edu-table-column>
          <edu-table-column :label="$t('interdisciplinaryManagement.applyMajor')" prop="applyMajor" width="120"></edu-table-column>
          <edu-table-column :label="$t('interdisciplinaryManagement.appliedDirection')" prop="applyDirection" width="120"></edu-table-column>
          <edu-table-column :label="$t('interdisciplinaryManagement.appliesStartExchange')" prop="tutorStartTime" width="160"> </edu-table-column>
          <edu-table-column :label="$t('interdisciplinaryManagement.appliesEndExchange')" prop="tutorEndTime" width="160"></edu-table-column>
          <edu-table-column :label="$t('interdisciplinaryManagement.studentsStartExchange')" prop="studentStartTime" width="160"></edu-table-column>
          <edu-table-column :label="$t('interdisciplinaryManagement.studentsEndExchange')" prop="studentEndTime" width="160"></edu-table-column>
          <edu-table-column :label="$t('common.text.operation')" fit prop="operate" width="150">
          <template slot-scope="props">
            <el-button type="text" @click="editInternEval(props.row)">{{$t('interdisciplinaryManagement.edit')}}</el-button>
            <el-button type="text" @click="examineDetails(props.row)">{{$t('interdisciplinaryManagement.examine')}}</el-button>
            <el-button type="text" @click="selectEvalRemove(props.row)">{{$t('interdisciplinaryManagement.remove')}}</el-button>
          </template>
        </edu-table-column>
          
        </edu-table>
        <el-row type="flex" class="row-bg" justify="end">
          <el-col>
              <el-pagination
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="queryForm.pageNum_"
                :page-sizes="[20, 40, 80, 100]"
                :page-size="queryForm.pageSize_"
                layout="total, sizes, prev, pager, next, jumper"
                :total="queryForm.total_"
                style="float:right;margin-top:10px"
              ></el-pagination>
          </el-col>
        </el-row>
      </el-card>
      <edu-export-dialog
        :disabled="exportButton"
        :title="$t('message.prompt')"
        ref="downloadRef"
        :data="exportResult">
      </edu-export-dialog>
    </div>
    <!-- 新增 -->
    <div v-if="indexKey === 2">
      <list-interdiAdd @change-exam='changeExam' ref="addFinom" @change-add='changeAdd' :compile='compile' :dataList='dataListObj'></list-interdiAdd>
    </div>
    <!-- 编辑/查看 -->
    <div v-if="indexKey === 3">
      <list-interdiEdit @change-exam='changeExam' :compile='compile' :dataList='dataListObj'></list-interdiEdit>
    </div>
  </div>
</template>
<script>
import { queryDic } from "common/src/api/dictionary";
import UTILS from "common/src/utils/utils";
import interManagementApi from 'common/src/api/externalExchange/interdiSciplinaryManagement';
import interAcaConferenceApi from 'common/src/api/internationalCommunication/interAcaConference'
import store from 'common/src/store';
// import subjectCompetitionApi from 'common/src/api/subjectCompetition/subjectCompetition';
import interdiAdd from './interdiSciplinaryManagementAdd';
import interdiEdit from './interdiSciplinaryManagementEdit';
import { getALLCollege } from 'common/src/api/internationalExchanges/exchangeCollegeManagement'
export default {
  components: {
    'list-interdiAdd': interdiAdd,
    'list-interdiEdit': interdiEdit
  },
  data() {
    return{
      fileList: [],
      indexKey: 1,
      compile: '',
      dataListObj: {},
      importConference: false,
      ifErr: false, // 是否展示错误信息
      formList: new FormData(),
      dataFormList: {}, //接收路由跳转的数据
      dataForm: {
        
      }, //表格数据
      internship: {
        opinion: ''
      },
      queryFormRmport: {
        calendarId: '',
        enclosureFileName: '',
        enclosureFileUrl: '',
        calendarName: ''
      },
      queryFormRmportId: '',
      queryCalendarName: '',
      dataList: [],
      exportButton: false,
      listRmportVisible: false,
      englishScoreManage: {
        cet4ScoreExcellent: ''
      },
      options: {
        faculty: [],
        country: [],
        nameSchool: []
      },
      dialogVisible: false,
      outsideAdvisorId: '',
      curCheckStandard: '',
      curPracticeId: '',
      queryForm: {
        condition: {
          teacherId: '',
          teacherName: '',
          nationId: '',
          tutorStartTime: '',
          tutorEndTime: '',
          studentStartTime: '',
          studentEndTime: '',
          collegeCode: ''
        },
        pageNum_: 1,
        pageSize_: 20,
        total_: 0,
      },
      loading: false,
      calendarName: '',
      useConfigParamList: '',
      useConfigParam: '',
      rulesRmport: {
        enclosureFileName: [
          { required: true, message: this.$t('internship.attachment'), trigger: 'change' } 
        ],
        calendarId: [
          { required: true, message: this.$t('internship.pleaseSelect'), trigger: 'change' } 
        ],
      },
      rules: {
        cet4ScoreExcellent: [
          { required: true, validator: this.validateWeight, trigger: 'blur' }
        ],
        english4PassScore: [
          { required: true, validator: this.validateWeight, trigger: 'blur' }
        ],
        elish6PassScore: [
          { required: true, validator: this.validateWeight, trigger: 'blur' }
        ],
        cet6ScoreExcellence: [
          { required: true, validator: this.validateWeight, trigger: 'blur' }
        ]
      },
      pickerOptionsStart: {
        disabledDate: time => {
          let endDateVal = this.queryForm.condition.tutorEndTime;
          if (endDateVal) {
            // return time.getTime() > endDateVal;
            return time.getTime() >= new Date(endDateVal).getTime();
          }
        }
      },
      pickerOptionsEnd: {
        disabledDate: time => {
          let beginDateVal = this.queryForm.condition.tutorStartTime;
          if (beginDateVal) {
            // return time.getTime() < beginDateVal;
            return time.getTime() <= new Date(beginDateVal).getTime()- 86400000;
          }
        }
      },
      pickerStudentStart: {
        disabledDate: time => {
          let endDateVal = this.queryForm.condition.studentEndTime;
          if (endDateVal) {
            // return time.getTime() > endDateVal;
            return time.getTime() >= new Date(endDateVal).getTime();
          }
        }
      },
      pickerStudentEndTime: {
        disabledDate: time => {
          let beginDateVal = this.queryForm.condition.studentStartTime;
          if (beginDateVal) {
            // return time.getTime() < beginDateVal;
            return time.getTime() <= new Date(beginDateVal).getTime()- 86400000;
          }
        }
      },
      errList: [],
      restaurants: [],
      semester: [],
      semesterRmpor: [],
      multipleSelection: [],
      tableData: []
    };
  },
  filters: {
    collegeAcademyList(val, array) {
      let str = "";
      for (let item of array) {
        if (val === item.value) {
          str = item.label;
        }
      }
      return str;
    }
  },
  created() {
    this.getColleges();
  },
  mounted() {
    // this.getOptions();
    this.changePostListPage(this.queryForm)
    // this.getQueryPractice();
    this.changeNameSchool();
  },
  methods: {
    async getColleges() {
        let { code, data } = await getALLCollege()
        if (code !== 200) return
        this.options.country = data.list.map(item => {
            return {
                value: item.id,
                label: item.nameCN
            }
        })
    },
    changePostListPage(data) {
      interManagementApi.postListPage(data).then(res => {
        this.dataList = res.data.list
        this.dataList.forEach(el => {
          el.collegeName = store.getters.language=='cn' ? el.collegeName : el.collegeNameEn
        })
        this.queryForm.total_ = res.data.total_
        // dataList
      })
    },
    // 编辑
    editInternEval(data) {
      interManagementApi.interdisciplineDetail(data.id).then(res => {
        this.compile = '编辑'
        this.dataListObj = res.data
        this.indexKey = 3
      });
    },
    // 查看
    examineDetails(data) {
      interManagementApi.interdisciplineDetail(data.id).then(res => {
        
        this.dataListObj = res.data
        this.indexKey = 3
        this.compile = '查看'
      });
    },
    // 删除
    selectEvalRemove(data) {
      this.$delConfirm().then(() => {

        let list = []
        list.push({id: data.id});
        interManagementApi.importExcelDelete(list).then(res => {
          this.$message(this.$t('internship.successfully'));
          this.queryForm.pageNum_ = 1;
          this.changePostListPage(this.queryForm)
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: this.$t('internship.cancelOpera')
        });  
      });
      
    },
    // 校验
    validateWeight(rule, value, callback) {
      let expReg = /^([1-9]|[1-9]\d{1,2})(\.\d{1,2})?$/;
      // let expReg = /^([1-9][0-9]*){1,3}(\.\d{2})?$/;
      if (!value) {
        callback(new Error(this.$t('internship.pleaseEnter')));
      } else if (!expReg.test(value)) {
        callback(new Error(this.$t('englishScoreManage.pleaseEnter')))
      } else {
        callback();
      }
    },
    remoteMethod(query) {
    // querySearch(queryString, cb) {
      if (query !== '') {
          this.loading = true;
          setTimeout(() => {
            this.loading = false;
            this.options.nameSchool = this.options.nameSchool.filter(item => {
              return item.collegeName.toLowerCase()
                .indexOf(query.toLowerCase()) > -1;
            });
          }, 200);
        } else {
          this.options.nameSchool = [];
        }
    },
    createFilter(queryString) {
      return (restaurant) => {
        return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
        // return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0 || restaurant.code.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
      };
    },
    // 导入
    leadFile(command) {
      if (command=='导入') {
        this.importConference = true
        this.$refs.importBtn.click();
        this.errList = []
        this.ifErr = false
      }
    },
    downloadFile(command) {
      if (command === '导入') {
        this.importConference = true
        this.errList = []
        this.ifErr = false
      } else if (command === '下载') {
        interManagementApi.importTemplate().then(res => {
          this.importConference = false
          this.$message.success(this.$t('internship.successfully'));
        });
      }
    },
    changeUpload(file) {
      if (!file.name.endsWith(".xlsx") && !file.name.endsWith(".xls")){
        this.fileList = [];
        return this.$message.warning(this.$t('cetStatistics.formatError'))
      }
    },
    changeSuccess(res, file, fileList) {
      if (res.code == 200) {
        this.$message({type: "success", message: this.$t('internship.successfully')});
        this.importConference = false
        this.queryForm.pageNum_ = 1;
        this.changePostListPage(this.queryForm)
      } else {
        this.fileList = []
        if (res.data) {
          this.errList = res.data
          this.ifErr = true
          this.$message({type: "info", message: this.$t('statisticsOfAwards.addedFully')});
        } else {
          this.$message({type: "info", message: res.msg});
        }
      }
      
    },
    // 导出
    exportFile() {
      if (this.multipleSelection.length > 0) {
        let selectRowListIds = []
        this.multipleSelection.forEach(el => {
          selectRowListIds.push(el.id);
        })
        interManagementApi.interdisciplineExport({selectRowListIds}).then(res => {
          this.$message(this.$t('internship.successfully'));
        })
      } else {
        interManagementApi.interdisciplineExport(this.queryForm.condition).then(res => {
          this.$message(this.$t('internship.successfully'));
        })
      }
    },
    // 新增
    increased() {
      this.compile = '新增'
      this.indexKey = 2
    },
    // 删除
    remove() {
      if (this.multipleSelection.length > 0) {
        this.$delConfirm().then(() => {
          let list = []
          this.multipleSelection.forEach(el => {
            list.push({id: el.id});
          })
          interManagementApi.importExcelDelete(list).then(res => {
            this.$message(this.$t('internship.successfully'));
            this.queryForm.pageNum_ = 1;
            this.changePostListPage(this.queryForm)
          })
        }).catch(() => {
          this.$message({
            type: 'info',
            message: this.$t('internship.cancelOpera')
          });          
        });
      } else {
        this.$message.error(this.$t('interdisciplinaryManagement.interdisciSelect'));
        
      }
    },
    // 返回列表主页
    changeExam() {
      this.indexKey = 1
      this.multipleSelection = []
      this.queryForm.pageNum_ = 1
      this.changePostListPage(this.queryForm)
    },
    changeAdd(data) {
      let list = []
      data.studentList.forEach(el => {
        // list.push({
          // "studentId": el.studentId,
          el.phone = el.phoneNumber
          // "email": el.email
        // })
      })
      // data.studentList = list
      interManagementApi.interdisciplineAdd(data).then(res => {
        this.$message.success(this.$t('internship.successfully')); 
        this.$refs.addFinom.cancelClose()
        this.indexKey = 1
        this.queryForm.pageNum_ = 1
        this.changePostListPage(this.queryForm)
      })
    },
    changeCountry(val) {
      this.queryForm.condition.collegeCode = '';
      this.queryForm.condition.nationId = val;
      let obj = {
        condition: {
          nationId: val,
        },
        pageNum_: 1,
        pageSize_: 20
      }
      this.postApproveAgree(obj);
    },
    changeNameSchool() {
      if (!this.queryForm.condition.nationId) {
        let obj = {
          condition: {
            nationId: null,
          },
          pageNum_: 1,
          pageSize_: 20
        }
        this.postApproveAgree(obj);
      }
    },
    
    getQueryPractice() {
      subjectCompetitionApi.postComputerManagement(this.queryForm).then(res => {
        // console.log(res, 'sdfds');
        this.dataList = res.data.list
        this.queryForm.total_ = res.data.total_
      });
    },
    // 导入
    exportLead() {
      // this.getSchoolCalendar();
      this.queryFormRmport.calendarId = this.queryFormRmportId
      this.listRmportVisible = true;
    },
    // 勾选
    handleSelectionChange(val) {
      this.multipleSelection = val;
      
    },
    postApproveAgree(date) {
      interAcaConferenceApi.overseasCollege(date).then(res => {
          // this.queryForm.pageNum_ = res.data.pageNum_
          // this.queryForm.pageSize_ = res.data.pageSize_
          // this.queryForm.total_ = res.data.total_
          this.options.nameSchool = res.data.list
          // console.log(this.options);
          
      })
    },
    getOptions() {
      // 筛选条件字典查询
      let data = {
        lang: this.$store.getters.language || "cn",
        type: "allChild",
        keys: ["X_YX", 'G_XBIE', "JDJB", 'G_GJQU']
      };
      queryDic(data).then(res => {
        UTILS.fillSelect(
          {
            faculty: "X_YX",
            // country: "G_GJQU",
            degreeType: "JDJB",
            sex:"G_XBIE"
          },
          res.data,
          this.options
        );
        // console.log(this.options);
      });
    },
    // 筛选
    onSearch() {
      this.queryForm.pageNum_ = 1
      this.changePostListPage(this.queryForm)
    },
    // 重置
    resetSearch() {
      // this.queryForm.condition.student = ''
      // this.queryForm.condition.calendarId = this.useConfigParamList;
      for (let key in this.queryForm.condition) {
        this.queryForm.condition[key] = '';
      }
      this.changeNameSchool();
      this.queryForm.pageNum_ = 1
      this.changePostListPage(this.queryForm)
    },
    // 取消
    cancelRmport() {
      
      this.listRmportVisible = false;
    },
    // 上传之前
    handleChange(file) {
      if (!file.name.endsWith(".xlsx") && !file.name.endsWith(".xls")){
        this.fileList = [];
        this.formList = new FormData();
        return this.$message.warning(this.$t('cetStatistics.formatError'))
      }
      this.queryFormRmport.enclosureFileName = 'a';
    },
   
    setInformationAttachList(fileList) {
      let attachList = [];
      fileList.forEach(item => {
        if (item.response && item.response.data) {
          const uploadedObj = item.response.data[item.name];
          if (uploadedObj) {
            this.queryFormRmport.enclosureFileName = uploadedObj.fileName;
            this.queryFormRmport.enclosureFileUrl = uploadedObj.objectkey;
          }
        }
      });
    },
    changeRequest(file) {
      this.formList.append("file", file.file);
    },
    // 导入确定
    reliableRmport() {
      this.$refs['queryFormRmport'].validate((valid) => {
        if (valid) {
          // console.log(this.queryFormRmport);
          this.$refs.uploadLead.submit();
          this.formList.append("calendarId", this.queryFormRmport.calendarId);
          this.formList.append("educationTag", Number(this.$store.getters.getProjectId()));
          subjectCompetitionApi.postComputerRmport(this.formList).then(() => {
            this.$message.success(this.$t('studentsRegist.successfully'));
            this.formList = new FormData();
            this.fileList = [];
            this.listRmportVisible = false;
            this.queryForm.pageNum_ = 1
            this.getQueryPractice();
          }).catch(() =>{
            this.formList = new FormData();
            this.fileList = [];
            this.queryFormRmport.enclosureFileName = '';
            // this.listRmportVisible = false;
          });
        }
      });
    },
    handleSizeChange(val) {
      this.queryForm.pageSize_ = val
      this.queryForm.pageNum_ = 1
      this.changePostListPage(this.queryForm)
    },
    handleCurrentChange(val) {
      this.queryForm.pageNum_ = val
      this.changePostListPage(this.queryForm)
    },
    goBack() {
      this.$store.commit("delete_tabs", this.$route.path);
      this.$router.go(-1);
    }
  }
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.p_cals:hover{
  cursor: pointer;
  color: #409eff;
}
.p_cals{
  color: #aaa
}
.inner-breadcrumb {
    .breadcrumb {
        span {
            font-weight: normal;
            color: #aaa;
        }
        a {
            font-weight: normal;
            color: #aaa;
        }
        a:hover {
            color: #409eff;
        }
        .last {
            font-weight: bold !important;
            cursor: default !important;
        }
        .disable {
            cursor: default !important;
        }
    }
}
.condition-title-p {
    font-weight: 400;
    font-style: normal;
    color: #2b3b4e;
    font-size: 18px;
    margin-bottom: 15px;
}
.base-info-title {
    font-weight: 400;
    font-style: normal;
    font-size: 16px;
    color: #2b3b4e;
}
.table-style-baseinfo {
    background-color: rgba(210, 212, 214, 1);
    box-sizing: border-box;
    border-width: 0.5px;
    border-style: solid;
    border-color: rgba(210, 212, 214, 1);
    border-radius: 0px;
    -moz-box-shadow: none;
    -webkit-box-shadow: none;
    box-shadow: none;
    width: 100%;
    font-weight: 401;
    font-style: normal;
    font-size: 14px;
    color: #8896a7;
    margin-bottom: 20px;
}

.table-style-baseinfo td {
    width: 25%;
    background-color: rgba(255, 255, 255, 1);
    border: none;
    border-radius: 0px;
    -moz-box-shadow: none;
    -webkit-box-shadow: none;
    box-shadow: none;
    font-weight: 401;
    font-style: normal;
    font-size: 14px;
    color: #2b3b4e;
    height: 32px;
    padding: 0 10px;
}

.table-style-baseinfo .text-right-background-color {
    background-color: #fdfeff4d;
    text-align: right;
}

.text-left-background-none {
    text-align: left;
}
</style>